

var Products = [];

//tmp温度
Products["wind"]={
    "id": "wind",
    "name": "风力风向",
    "unit": "米/秒",
    "source":"gfs",
    "file": "current-wind-surface-level-gfs-0.5.epak",
    "tmplet": "{HHmm}-wind-isobaric-1000hPa-gfs-0.5.epak", //https://gaia.nullschool.net/data/gfs/2017/01/01/1500-wind-isobaric-1000hPa-gfs-0.5.epak 
    "surface": "{HHmm}-wind-surface-level-gfs-0.5.epak",//1200-wind-surface-level-gfs-0.5.epak
    "height": "[1000,850,700,500,250,70,10]",
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 999])
        .range([d3.rgb(37, 4, 42), d3.rgb(41, 10, 130), d3.rgb(81, 40, 40),
        d3.rgb(192, 37, 149), d3.rgb(70, 215, 215), d3.rgb(21, 84, 187),
        d3.rgb(24, 132, 14), d3.rgb(247, 251, 59), d3.rgb(235, 167, 21),
        d3.rgb(230, 71, 39), d3.rgb(88, 27, 67)])
        .interpolate(d3.interpolateHcl)
};

//tmp温度
Products["temp"]={
    "id": "temp",
    "name": "温度",
    "unit": "℃",
    "source": "gfs",
    "file": "current-temp-surface-level-gfs-0.5.epak", 
    "tmplet": "{HHmm}-temp-surface-level-gfs-0.5.epak", //https://gaia.nullschool.net/data/gfs/2017/01/02/1200-temp-surface-level-gfs-0.5.epak
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([193, 206, 219, 233.15, 255.372, 273.15, 275.15, 291, 298, 311, 328])
        .range([d3.rgb(37, 4, 42), d3.rgb(41, 10, 130), d3.rgb(81, 40, 40),
        d3.rgb(192, 37, 149), d3.rgb(70, 215, 215), d3.rgb(21, 84, 187),
        d3.rgb(24, 132, 14), d3.rgb(247, 251, 59), d3.rgb(235, 167, 21),
        d3.rgb(230, 71, 39), d3.rgb(88, 27, 67)])
        .interpolate(d3.interpolateHcl)
};
//缺少相对湿度 https://gaia.nullschool.net/data/gfs/current/current-relative_humidity-surface-level-gfs-0.5.epak

//cosc一氧化碳浓度
Products["cosc"]={
    "id": "cosc",
    "name": "地表一氧化碳浓度",
    "unit": "ppm",
    "source": "geos",
    "file": "current-cosc-geos.epak", //
    "tmplet": "{HHmm}-cosc-geos.epak", //https://gaia.nullschool.net/data/geos/2017/01/02/0900-cosc-geos.epak
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([40, 400, 1800, 2500])
        .range([d3.rgb(0, 38, 40), d3.rgb(255, 255, 224),
        d3.rgb(0, 0, 154), d3.rgb(0, 0, 0)])
        .interpolate(d3.interpolateHcl)
};
/*
 * 0,[37, 79, 92, 160]
10,[220, 235, 249, 160]
20,[83, 119, 207, 160]
30,[114, 0, 152, 160]
40,[171, 0, 139, 160]
50,[232, 0, 110, 160]
 */
Products["p3hr"]={
    "id": "precip_3hr",
    "name": "三小时累计降雨量",
    "unit": "mm",
    "source": "gfs",
    "file": "current-precip_3hr-gfs-0.5.epak", //
    "tmplet": "{HHmm}-precip_3hr-gfs-0.5.epak", //https://gaia.nullschool.net/data/gfs/2017/01/02/1200-precip_3hr-gfs-0.5.epak
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([0, 10, 20, 30, 40, 50])
	        .range([d3.rgb(37, 79, 92, 160), d3.rgb(220, 235, 249, 160), d3.rgb(83, 119, 207, 160),
        d3.rgb(114, 0, 152, 160), d3.rgb(171, 0, 139, 160), d3.rgb(232, 0, 110, 160)])
	        .interpolate(d3.interpolateHcl)
};
/*
 * air>cape
0, [5, 48, 97]
500, [33, 102, 172]
1000, [67, 147, 195]
1500, [146, 197, 222]
2000, [209, 229, 240]
2500, [247, 247, 247]
3000, [253, 219, 199]
3500, [244, 165, 130]
4000, [214, 96, 77]
4500, [178, 24, 43]
5000, [103, 0, 31]
 */
Products["cape"]={
    "id": "cape",
    "name": "对流可用位能",
    "unit": "ppm",
    "source": "gfs",
    "file": "current-cape-gfs-0.5.epak",
    "tmplet": "{HHmm}-cape-gfs-0.5.epak", //https://gaia.nullschool.net/data/gfs/2017/01/02/0900-cape-gfs-0.5.epak
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([0, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000])
	        .range([d3.rgb(5, 48, 97), d3.rgb(33, 102, 172), d3.rgb(67, 147, 195),
        d3.rgb(146, 197, 222), d3.rgb(209, 229, 240), d3.rgb(247, 247, 247),
        d3.rgb(253, 219, 199), d3.rgb(244, 165, 130), d3.rgb(214, 96, 77),
        d3.rgb(178, 24, 43), d3.rgb(103, 0, 31)])
	        .interpolate(d3.interpolateHcl)
};

/*air>TPW
0,[120, 100, 30, 112]
10,[228, 164, 94, 112]
20,[119, 99, 94, 112]
30,[39, 43, 192, 112]
40,[74, 62, 234, 112]
50,[74, 158, 244, 112]
60,[49, 254, 254, 112]
70,[149, 255, 255, 112]
80,[150, 255, 255, 112]
*/
Products["tpw"]={
    "id": "total_precipitable_water",
    "name": "水汽含量",
    "unit": "ppm",
    "source": "gfs",
    "file": "current-total_precipitable_water-gfs-0.5.epak",
    "tmplet": "{HHmm}-total_precipitable_water-gfs-0.5.epak", //https://gaia.nullschool.net/data/gfs/2017/01/02/0900-total_precipitable_water-gfs-0.5.epak
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([0, 10, 20, 30, 40, 50, 60, 70, 80])
	        .range([d3.rgb(120, 100, 30, 112), d3.rgb(228, 164, 94, 112), d3.rgb(119, 99, 94, 112),
        d3.rgb(39, 43, 192, 112), d3.rgb(74, 62, 234, 112), d3.rgb(74, 158, 244, 112),
        d3.rgb(49, 254, 254, 112), d3.rgb(149, 255, 255, 112), d3.rgb(150, 255, 255, 112)])
	        .interpolate(d3.interpolateHcl)
};

/*

air>TCW
0,[5, 5, 89, 112]
1,[255, 255, 255, 112]
2,[255, 255, 255, 112]
3,[255, 255, 255, 112]
4,[255, 255, 255, 112]
5,[255, 255, 255, 112]
*/
Products["tcw"]={
    "id": "total_cloud_water",
    "name": "云中含水量",
    "unit": "ppm",
    "source": "gfs",
    "file": "current-total_cloud_water-gfs-0.5.epak",  //
    "tmplet": "{HHmm}-total_cloud_water-gfs-0.5.epak", //https://gaia.nullschool.net/data/gfs/2017/01/02/0900-total_cloud_water-gfs-0.5.epak
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([0, 1, 2, 3, 4, 5])
	        .range([d3.rgb(5, 5, 89, 112), d3.rgb(255, 255, 255, 112), d3.rgb(255, 255, 255, 112),
        d3.rgb(255, 255, 255, 112), d3.rgb(255, 255, 255, 112), d3.rgb(255, 255, 255, 112)])
	        .interpolate(d3.interpolateHcl)
};
/*

air>MSLP
0,[162, 49, 25, 112]
95000,[186, 59, 30, 112]
96000,[186, 59, 30, 112]
97000,[153, 41, 34, 112]
98000,[96, 21, 43, 112]
99000,[24, 1, 63, 112]
100000,[32, 1, 83, 112]
101000,[164, 159, 93, 112]
102000,[241, 254, 102, 112]
103000,[235, 250, 222, 112]
104000,[241, 250, 238, 112]
105000,[245, 251, 243, 112]
*/
Products["mslp"]={
    "id": "mean_sea_level_pressure",
    "name": "平均海平面压力",
    "unit": "ppm",
    "source": "gfs",
    "file": "current-mean_sea_level_pressure-gfs-0.5.epak", 
    "tmplet": "{HHmm}-mean_sea_level_pressure-gfs-0.5.epak", //https://gaia.nullschool.net/data/gfs/2017/01/02/0900-mean_sea_level_pressure-gfs-0.5.epak
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([0, 95000, 96000, 97000, 98000, 99000, 100000, 101000, 102000, 103000, 104000, 105000])
	        .range([d3.rgb(162, 49, 25, 112), d3.rgb(186, 59, 30, 112), d3.rgb(186, 59, 30, 112),
        d3.rgb(153, 41, 34, 112), d3.rgb(255, 255, 255, 112), d3.rgb(24, 1, 63, 112),
        d3.rgb(32, 1, 83, 112), d3.rgb(164, 159, 93, 112), d3.rgb(241, 254, 102, 112),
        d3.rgb(235, 250, 222, 112), d3.rgb(241, 250, 238, 112), d3.rgb(245, 251, 243, 112)])
	        .interpolate(d3.interpolateHcl)
};
/*

air>MI
0,[255, 255, 255, 112]
200,[255, 255, 255, 112]
250,[255, 255, 255, 112]
300,[46, 131, 255, 112]
350,[249, 231, 124, 112]
*/
Products["mi"]={
    "id": "misery_index",
    "name": "体感温度",
    "unit": "ppm",
    "source": "gfs",
    "file": "current-misery_index-gfs-0.5.epak", 
    "tmplet": "{HHmm}-misery_index-gfs-0.5.epak", //https://gaia.nullschool.net/data/gfs/2017/01/02/0900-misery_index-gfs-0.5.epak
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([0, 200, 250, 300, 350])
	        .range([d3.rgb(255, 255, 255, 112), d3.rgb(255, 255, 255, 112), d3.rgb(255, 255, 255, 112),
        d3.rgb(46, 131, 255, 112), d3.rgb(249, 231, 124, 112)])
	        .interpolate(d3.interpolateHcl)
};

/*

Chem>SOSC
0,[3, 40, 42, 140]
500,[251, 249, 217, 140]
1000,[247, 236, 196, 140]
1500,[228, 131, 117, 140]
3000,[0, 0, 0, 140]
*/
Products["sosc"]={
    "id": "sosc",
    "name": "地表一氧化碳浓度",
    "unit": "ppm",
    "source": "geos",
    "file": "current-cosc-geos.epak",
    "tmplet": "{HHmm}-cosc-geos.epak", //https://gaia.nullschool.net/data/gfs/2017/01/02/0900-misery_index-gfs-0.5.epak
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([0, 500, 1000, 1500, 3000])
	        .range([d3.rgb(3, 40, 42, 140), d3.rgb(251, 249, 217, 140), d3.rgb(247, 236, 196, 140),
        d3.rgb(228, 131, 117, 140), d3.rgb(0, 0, 0, 140)])
	        .interpolate(d3.interpolateHcl)
};
/*

Chem>CO2sc
0,[0, 0, 0, 150] 
350,[0, 0, 0, 150]
400,[184, 80, 18, 150]
450,[252, 248, 218, 150]
*/
Products["co2sc"]={
    "id": "co2sc",
    "name": "二氧化碳浓度",
    "unit": "ppm",
    "source": "geos",
    "file": "current-co2sc-geos.epak",
    "tmplet": "{HHmm}-co2sc-geos.epak", //https://gaia.nullschool.net/data/gfs/2017/01/02/0900-misery_index-gfs-0.5.epak
    "times": ['0130','0430','0730','1030','1330','1630','1930','2230'],
    "color": d3.scaleLinear().domain([0, 350, 400, 450])
	        .range([d3.rgb(0, 0, 0, 250), d3.rgb(0, 0, 0, 250), d3.rgb(184, 80, 18, 250),
        d3.rgb(252, 248, 218, 250)])
	        .interpolate(d3.interpolateHcl)
};
/*

Chem>SO2sm----------这个可能不准确
0.0000006,[28, 0, 37, 140]
0,[134, 134, 107, 140]
0.02,[252, 250, 219, 140]  //
*/
 
Products["co2sm"]={
    "id": "co2sm",
    "name": "二氧化碳浓度",
    "unit": "ppm",
    "source": "geos",
    "file": "current-co2sm-geos.epak", //https://gaia.nullschool.net/data/geos/2017/01/02/0900-so2smass-geos.epak
    "tmplet": "{HHmm}-co2sm-geos.epak", //https://gaia.nullschool.net/data/gfs/2017/01/02/0900-misery_index-gfs-0.5.epak
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([0, 350, 400, 450])
	        .range([d3.rgb(0, 0, 0, 250), d3.rgb(0, 0, 0, 250), d3.rgb(184, 80, 18, 250),
        d3.rgb(252, 248, 218, 250)])
	        .interpolate(d3.interpolateHcl)
};

/*

Particulates>DUex
0,[7, 89, 118, 140]
0.2,[161, 197, 138, 140]
0.4,[212, 203, 95, 140]
0.6,[231, 209, 151, 140]
0.8,[243, 214, 179, 140]
1,[248, 220, 198, 140]
1.2,[248, 226, 209, 140]
1.4,[247, 231, 218, 140]
 */
Products["duex"]={
    "id": "duex",
    "name": "尘埃消光",
    "unit": "ppm",
    "source": "geos",
    "file": "current-duexttau-geos.epak",
    "tmplet": "{HHmm}-duexttau-geos.epak", //https://gaia.nullschool.net/data/gfs/2017/01/02/0900-misery_index-gfs-0.5.epak
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4])
	        .range([d3.rgb(7, 89, 118, 140), d3.rgb(161, 197, 138, 140), d3.rgb(212, 203, 95, 140),
        d3.rgb(231, 209, 151, 140), d3.rgb(243, 214, 179, 140), d3.rgb(248, 220, 198, 140),
        d3.rgb(248, 226, 209, 140), d3.rgb(247, 231, 218, 140)])
	        .interpolate(d3.interpolateHcl)
};
/*
 * 
Particulates>SO4ex
0,[24, 51, 75, 140]
0.2,[213, 137, 183, 140]
0.4,[213, 175, 235, 140]
0.6,[200, 201, 243, 140]
0.8,[195, 218, 243, 140]
1,[198, 224, 242, 140]
1.2,[207, 235, 239, 140]
1.4,[217, 242, 239, 140]
2.2,[247, 253, 249, 140]
*/
Products["so4ex"]={
    "id": "so4ex",
    "name": "尘埃消光(气溶胶光学厚度，550纳米)",
    "unit": "ppm",
    "source": "geos",
    "file": "current-suexttau-geos.epak",
    "tmplet": "{HHmm}-suexttau-geos.epak", //https://gaia.nullschool.net/data/gfs/2017/01/02/0900-misery_index-gfs-0.5.epak
    "times": ['00','03','06','09','12','15','18','21'],
    "color": d3.scaleLinear().domain([0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 2.2])
	        .range([d3.rgb(24, 51, 75, 140), d3.rgb(213, 137, 183, 140), d3.rgb(213, 175, 235, 140),
        d3.rgb(200, 201, 243, 140), d3.rgb(195, 218, 243, 140), d3.rgb(198, 224, 242, 140),
        d3.rgb(207, 235, 239, 140), d3.rgb(217, 242, 239, 140), d3.rgb(247, 253, 249, 140)])
	        .interpolate(d3.interpolateHcl)
};
